<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: FCSParse::FCSFile
  
    &mdash; Documentation by YARD 0.8.2.1
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (F)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../FCSParse.html" title="FCSParse (module)">FCSParse</a></span></span>
     &raquo; 
    <span class="title">FCSFile</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: FCSParse::FCSFile
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">FCSParse::FCSFile</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/fcsparse.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    
<p>A class representing an FCS-encoded file.  Has methods to parse the data,
manage it, and convert it to human-readable format.</p>

<p>Currently reads FCS v3.x files.  Files must have data encoded in list mode,
and data points must be in float or double format (this will change
eventually to support all formats in the specification).</p>

<p>Analysis sections of the file are ignored.</p>

<p>Data can be written to delimited text files, and metadata to plain text
files, or the objects containing the data can be used by other code to
process the data further.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Author:</p>
<ul class="author">
  
    <li>
      
      
      
      
        
        <div class='inline'>
<p>Colin J. Fuller</p>
</div>
      
    </li>
  
</ul>

</div>
  <h2>Constant Summary</h2>
  
    <dl class="constants">
      
        <dt id="MetadataExtension-constant" class="">MetadataExtension =
          
        </dt>
        <dd><pre class="code"><span class='string val'>&quot;.meta.txt&quot;</span>
</pre></dd>
      
        <dt id="DataExtension-constant" class="">DataExtension =
          
        </dt>
        <dd><pre class="code"><span class='string val'>&quot;.data.csv&quot;</span>
</pre></dd>
      
        <dt id="DataDelimiter-constant" class="">DataDelimiter =
          
        </dt>
        <dd><pre class="code"><span class='rubyid_FCSEvent constant id'>FCSEvent</span><span class='colon2 op'>::</span><span class='rubyid_DefaultDelimiter constant id'>DefaultDelimiter</span>
</pre></dd>
      
        <dt id="SupportedVersions-constant" class="">SupportedVersions =
          
        </dt>
        <dd><pre class="code"><span class='lbrack token'>[</span><span class='string val'>&quot;FCS3.0&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;FCS3.1&quot;</span><span class='rbrack token'>]</span>
</pre></dd>
      
    </dl>
  




  <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#events-instance_method" title="#events (instance method)">- (Object) <strong>events</strong> </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute events.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#filename-instance_method" title="#filename (instance method)">- (Object) <strong>filename</strong> </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute filename.</p>
</div></span>
  
</li>

    
  </ul>




  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#new_from_file-class_method" title="new_from_file (class method)">+ (FCSFile) <strong>new_from_file</strong>(filename) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Generates a new FCSFile object from the specified file.</p>
</div></span>
  
</li>

      
    </ul>
  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#get_metadata_string-instance_method" title="#get_metadata_string (instance method)">- (String) <strong>get_metadata_string</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Gets the metadata (that is all the information in the text block of the fcs
file) as a string, where there is one key, value pair per line, separated
by the characters “ =&gt; ”.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (FCSFile) <strong>initialize</strong>(file_string) </a>
    

    
  </span>
  
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Generates a new FCSFile from the specified FCS-encoded data string.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#parse-instance_method" title="#parse (instance method)">- (Object) <strong>parse</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Parses the raw data loaded in the FCSFile to metadata, events, and
parameters.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#print_metadata-instance_method" title="#print_metadata (instance method)">- (Object) <strong>print_metadata</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Prints the metadata string returned by <span class='object_link'><a href="#get_metadata_string-instance_method" title="FCSParse::FCSFile#get_metadata_string (method)">#get_metadata_string</a></span>.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#write_metadata_and_data-instance_method" title="#write_metadata_and_data (instance method)">- (Object) <strong>write_metadata_and_data</strong>(write_header_row = true) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Writes the metadata and data from the FCS-formatted file to disk in human
readable format.</p>
</div></span>
  
</li>

      
    </ul>
  

<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <h3 class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="FCSParse::FCSFile (class)">FCSFile</a></span></tt>) <strong>initialize</strong>(file_string) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Generates a new FCSFile from the specified FCS-encoded data string.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>file_string</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>a String containing an FCS-encoded dataset.</p>
</div>
      
    </li>
  
</ul>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


87
88
89
90</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 87</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_file_string identifier id'>file_string</span><span class='rparen token'>)</span>
  <span class='rubyid_@data ivar id'>@data</span> <span class='assign token'>=</span> <span class='rubyid_file_string identifier id'>file_string</span>
  <span class='rubyid_@keywords ivar id'>@keywords</span> <span class='assign token'>=</span> <span class='rubyid_Hash constant id'>Hash</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="events=-instance_method"></span>
      <div class="method_details first">
  <h3 class="signature first" id="events-instance_method">
  
    - (<tt>Object</tt>) <strong>events</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns the value of attribute events</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


58
59
60</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 58</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_events identifier id'>events</span>
  <span class='rubyid_@events ivar id'>@events</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="filename=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="filename-instance_method">
  
    - (<tt>Object</tt>) <strong>filename</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns the value of attribute filename</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


58
59
60</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 58</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_filename identifier id'>filename</span>
  <span class='rubyid_@filename ivar id'>@filename</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="new_from_file-class_method">
  
    + (<tt><span class='object_link'><a href="" title="FCSParse::FCSFile (class)">FCSFile</a></span></tt>) <strong>new_from_file</strong>(filename) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Generates a new FCSFile object from the specified file.</p>

<p>Calling this will read the entire file into memory but will not parse it.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>filename</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>the filename of the FCS-encoded file (with path as required to locate it)</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="FCSParse::FCSFile (class)">FCSFile</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>a new FCSFile object initialized with the contents of the file.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


69
70
71
72
73
74
75
76
77
78
79
80
81</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 69</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_new_from_file identifier id'>new_from_file</span><span class='lparen token'>(</span><span class='rubyid_filename identifier id'>filename</span><span class='rparen token'>)</span>
  
  <span class='rubyid_fcsfile identifier id'>fcsfile</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span>
  
  <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_filename identifier id'>filename</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
    <span class='rubyid_fcsfile identifier id'>fcsfile</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_read identifier id'>read</span><span class='rparen token'>)</span>
  <span class='rubyid_end end kw'>end</span>
  
  <span class='rubyid_fcsfile identifier id'>fcsfile</span><span class='dot token'>.</span><span class='rubyid_filename identifier id'>filename</span> <span class='assign token'>=</span> <span class='rubyid_filename identifier id'>filename</span>
  
  <span class='rubyid_fcsfile identifier id'>fcsfile</span>
  
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="get_metadata_string-instance_method">
  
    - (<tt>String</tt>) <strong>get_metadata_string</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Gets the metadata (that is all the information in the text block of the fcs
file) as a string, where there is one key, value pair per line, separated
by the characters “ =&gt; ”</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>a String containing all the metadata</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


252
253
254
255
256
257
258</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 252</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_get_metadata_string identifier id'>get_metadata_string</span>
  <span class='rubyid_str identifier id'>str</span> <span class='assign token'>=</span> <span class='string val'>&quot;&quot;</span>
  <span class='rubyid_@keywords ivar id'>@keywords</span><span class='dot token'>.</span><span class='rubyid_keys identifier id'>keys</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='rubyid_e identifier id'>e</span><span class='bitor op'>|</span> <span class='rubyid_e identifier id'>e</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='rbrace token'>}</span><span class='dot token'>.</span><span class='rubyid_sort identifier id'>sort</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_k identifier id'>k</span><span class='bitor op'>|</span>
    <span class='rubyid_str identifier id'>str</span> <span class='lshft op'>&lt;&lt;</span> <span class='rubyid_k identifier id'>k</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span> <span class='plus op'>+</span> <span class='string val'>&quot; =&gt; &quot;</span> <span class='plus op'>+</span> <span class='rubyid_@keywords ivar id'>@keywords</span><span class='lbrack token'>[</span><span class='rubyid_k identifier id'>k</span><span class='dot token'>.</span><span class='rubyid_to_sym identifier id'>to_sym</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span> <span class='plus op'>+</span> <span class='string val'>&quot;\n&quot;</span>
  <span class='rubyid_end end kw'>end</span>
  <span class='rubyid_str identifier id'>str</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="parse-instance_method">
  
    - (<tt>Object</tt>) <strong>parse</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Parses the raw data loaded in the FCSFile to metadata, events, and
parameters.</p>

<p>Erases the raw data from the FCSFile object after parsing is complete.</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


324
325
326
327
328
329</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 324</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_parse identifier id'>parse</span>
  <span class='rubyid_read_header identifier id'>read_header</span>
  <span class='rubyid_parse_text_segment identifier id'>parse_text_segment</span>
  <span class='rubyid_parse_data_segment identifier id'>parse_data_segment</span>
  <span class='rubyid_@data ivar id'>@data</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="print_metadata-instance_method">
  
    - (<tt>Object</tt>) <strong>print_metadata</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Prints the metadata string returned by <span class='object_link'><a href="#get_metadata_string-instance_method" title="FCSParse::FCSFile#get_metadata_string (method)">#get_metadata_string</a></span>.</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


263
264
265
266
267
268
269</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 263</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_print_metadata identifier id'>print_metadata</span>

  <span class='rubyid_puts identifier id'>puts</span> <span class='rubyid_get_metadata_string identifier id'>get_metadata_string</span>
  
  <span class='rubyid_nil nil kw'>nil</span>
  
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="write_metadata_and_data-instance_method">
  
    - (<tt>Object</tt>) <strong>write_metadata_and_data</strong>(write_header_row = true) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Writes the metadata and data from the FCS-formatted file to disk in human
readable format.</p>

<p>The metadata is written as a text file (formatted by 
<span class='object_link'><a href="#get_metadata_string-instance_method" title="FCSParse::FCSFile#get_metadata_string (method)">#get_metadata_string</a></span>), in the same location as the input FCS file and
with the same name except for an extra extension specified in 
<span class='object_link'><a href="#MetadataExtension-constant" title="FCSParse::FCSFile::MetadataExtension (constant)">MetadataExtension</a></span>.</p>

<p>The data, delimited by the data delimiter specified as
<span class='object_link'><a href="#DataDelimiter-constant" title="FCSParse::FCSFile::DataDelimiter (constant)">DataDelimiter</a></span>, one row per event, is written to a text file in
the same location as the input FCS file and with the same name except for
an extra extension specified in <span class='object_link'><a href="#DataExtension-constant" title="FCSParse::FCSFile::DataExtension (constant)">DataExtension</a></span>.</p>

<p>the data file should have a header row with the name of each column’s 
parameter.  Defaults to true.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>write_header_row</span>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>true</tt>)</em>
      
      
        &mdash;
        <div class='inline'>
<p>an optional parameter specifying whether</p>
</div>
      
    </li>
  
</ul>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/fcsparse.rb', line 289</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_write_metadata_and_data identifier id'>write_metadata_and_data</span><span class='lparen token'>(</span><span class='rubyid_write_header_row identifier id'>write_header_row</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span>
  
  <span class='rubyid_meta_filename identifier id'>meta_filename</span> <span class='assign token'>=</span> <span class='rubyid_@filename ivar id'>@filename</span> <span class='plus op'>+</span> <span class='rubyid_MetadataExtension constant id'>MetadataExtension</span>
  
  <span class='rubyid_data_filename identifier id'>data_filename</span> <span class='assign token'>=</span> <span class='rubyid_@filename ivar id'>@filename</span> <span class='plus op'>+</span> <span class='rubyid_DataExtension constant id'>DataExtension</span>
  
  <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_meta_filename identifier id'>meta_filename</span><span class='comma token'>,</span> <span class='string val'>&quot;w&quot;</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
    
    <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_write identifier id'>write</span><span class='lparen token'>(</span><span class='rubyid_get_metadata_string identifier id'>get_metadata_string</span><span class='rparen token'>)</span>
    
  <span class='rubyid_end end kw'>end</span>
  
  <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_data_filename identifier id'>data_filename</span><span class='comma token'>,</span> <span class='string val'>&quot;w&quot;</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
    
    <span class='rubyid_if if kw'>if</span> <span class='rubyid_write_header_row identifier id'>write_header_row</span> <span class='rubyid_then then kw'>then</span>
      <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_puts identifier id'>puts</span><span class='lparen token'>(</span><span class='rubyid_@events ivar id'>@events</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_names_to_s_delim identifier id'>names_to_s_delim</span><span class='lparen token'>(</span><span class='rubyid_DataDelimiter constant id'>DataDelimiter</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
    <span class='rubyid_end end kw'>end</span>
    
    <span class='rubyid_@events ivar id'>@events</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_e identifier id'>e</span><span class='bitor op'>|</span>
      
      <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_puts identifier id'>puts</span><span class='lparen token'>(</span><span class='rubyid_e identifier id'>e</span><span class='dot token'>.</span><span class='rubyid_to_s_delim identifier id'>to_s_delim</span><span class='lparen token'>(</span><span class='rubyid_DataDelimiter constant id'>DataDelimiter</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
    
    <span class='rubyid_end end kw'>end</span>
    
  <span class='rubyid_end end kw'>end</span>
  
  <span class='rubyid_nil nil kw'>nil</span>
  
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Wed Jun 20 16:53:15 2012 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.2.1 (ruby-1.8.7).
</div>

  </body>
</html>